1. Field of the Invention
The present invention relates to an encoding device for encoding image data.
2. Related Background Art
Recently, there has been an increase in the number of applications for compressing static images as image data and for externally transmitting the compressed image data, or for storing it in a memory. For these purposes, it is preferable that lossless compression and encoding be used, especially when the data is for static images used for medical purposes, so that no deterioration of image quality occurs.
Accordingly, various efficient lossless compression and encoding methods have been proposed. For example, a compression and encoding method has been proposed for outputting a difference between a pixel to be encoded and a predicted value generated by using peripheral pixels, and for performing Golomb-Rice coding for this difference.
However, a specific device configuration for performing these proposed compression and encoding methods is not yet established.
To resolve this problem, it is one objective of the present invention to perform efficient lossless compression and encoding, and in particular to provide an arrangement for performing fast Golomb-Rice encoding that is applied for the lossless compression and encoding method.
To achieve the above objective, according to the present invention, an encoding device, which sequentially encodes a plurality of pixels, comprises:
state determination means (corresponding to state discrimination circuit 110 in the preferred embodiments) for determining, from a plurality of states, states of peripheral pixels (corresponding to state S in FIG. 4) of an object pixel to be encoded (corresponding to x);
predicted value generation means (corresponding to prediction unit 401 or an error feedback circuit 402) for producing a predicted value (corresponding to P or Pxe2x80x2) of the object pixel based on the peripheral pixels (corresponding to a, b and c);
a memory (corresponding to a memory 404) used for storing a k parameter (kxe2x89xa70) for each of the plurality of states;
variable-length coding means (corresponding to a Golomb-Rice encoding circuit 104) for encoding a prediction difference between the value of the object pixel and a predicted value to variable-length code having a code length that is obtained by using the prediction difference and the k parameter that is stored in the memory and corresponds to the state determined by the state determination means; and
k parameter updating means (corresponding to a k parameter generation circuit 406) for, after variable-length encoding is performed for the object pixel, updating in advance the k parameter in order to perform variable-length encoding for another pixel that has the same state as the state determined by the state determination means, and for writing the k parameter to the memory.
Further, to achieve the objective, an encoding device, which sequentially encodes a plurality of pixels, comprises:
state determination means for determining, from a plurality of states, a state of an object pixel to be encoded;
predicted value generation means for producing a predicted value of the object pixel;
a memory used for storing a k parameter (kxe2x89xa70) for each of the plurality of states;
variable-length coding means for encoding a prediction difference between the value of the object pixel and the predicted value to variable-length code having a code length that is obtained by using the prediction difference and the k parameter that is stored in the memory and corresponds to the state determined by the state determination means; and
k parameter updating means for, after variable-length encoding is performed for the object pixel, updating in advance the k parameter in order to perform variable-length encoding for another pixel that has the same state as the state determined by the state determination means, and for writing the k parameter to the memory.
In addition, to achieve the above objective, an encoding device, which sequentially encodes a plurality of pixels, comprises:
state determination means for determining, from a plurality of states, a state of object data to be encoded;
a memory used for storing a k parameter (kxe2x89xa70) for each of the plurality of states;
variable-length coding means for encoding the object data to variable-length code having a code length that is obtained by using the object data and the k parameter that is stored in the memory and corresponds to the state determined by the state determination means; and
k parameter updating means for, after variable-length encoding is performed for the object data, updating in advance the k parameter in order to perform variable-length encoding for different data that has the same state as the state determined by the state determination means, and for writing the k parameter to the memory.
Other objects and features of the present invention will become apparent during the course of the explanation for the following embodiments, given while referring to the accompanying drawings.